#pragma once

#include "form/IPane.h"
#include "Window.h"
#include "messenging/change/Observer.h"

class Pane: public Window<IPane>, public CObserver
{
public:
	BEGIN_DEFINE_CLASS(CLSID_Pane)
		DEFINE_INTERFACE_ENTRY(IPane)
		USE_INTERFACE_ENTRY(Window)
		USE_INTERFACE_ENTRY(CObserver)
	END_DEFINE_CLASS()

	Pane();
	virtual ~Pane();

	event_implement(BeingCreatedEventHandler,BeingCreated);
	event_implement(BeingUpdatedEventHandler,BeingUpdated);

public:
	virtual void SetDockinfo(dockAction action,IPane* neighbor);
	virtual void SetID(uint32 id);
	virtual uint32 GetID() const;
	virtual void Setvisible(bool visible=true);
	virtual bool Isvisible() const;
	virtual void SetSize(const Size& size);
	virtual const Size& GetSize() const;
	virtual void WatchObjects(viid subjectIID, viid interestedObjectIID);
	virtual void UnwatchObjects(viid subjectIID, viid interestedObjectIID);

	virtual void GetDockinfo(dockAction& dock,IPane*& neighbor) const;

protected:
	virtual void Update(const InterestedObjects& interestedObjects,IObject* subject,uint32 data);

private:
	bool m_visible;
	uint32 m_id;
	dockAction m_dockaction;
	IPane* m_dockneighbor;
	Size m_size;
};
AUTO_REGISTER_CLASSMAP_ENTRY(Pane)